<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />      
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/> 

        <link rel="stylesheet" type="text/css"
              href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
        <link rel="stylesheet" type="text/css"
              href="<?php echo Yii::app()->request->baseUrl; ?>/css/bilyn.css" />
        <link rel="stylesheet" type="text/css"
              href="<?php echo Yii::app()->request->baseUrl; ?>/css/form.css" />
        <link rel="stylesheet" type="text/css"
              href="<?php echo Yii::app()->request->baseUrl; ?>/css/bootstrap/css/bootstrap-responsive.min.css" />     

        <?php Yii::app()->clientScript->registerPackage('jquery') ?>

        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
    </head>
    <body> 
        <script type="text/javascript">
            /*<![CDATA[*/
            jQuery(function($) {
                var width = $(window).width();
                if(width < 767){
                    $('#page').css('margin-left','-20px');
                    $('#page').css('width',width -2 +'px');
                    /*  $('#footer ').css("text-align","left");*/
                    $("#div-main-logout").css('padding-left',width - 160 +'px');
                }              
            })   
            /*]]>*/
        </script>

        <div id="page" style="margin-left:150px;min-width: 380px">
            <div id="header" class="container hidden-phone">
                <div class="span3" style="margin-left:-40px">
                    <pt1> <?php echo CHtml::encode(Yii::app()->name); ?></pt1>                    
                </div>
                <div class="span6">
                    <pt2>Connect to world as knock at next door</pt2>
                </div>
            </div>            

            <!--  phone header -->
            <div class="hidden-desktop hidden-tablet">
                <div style="min-width:800px;border-color: #000;background-color: #2d2d2d;opacity: 1;height: 35px;">
                    <div class="span1" style="margin-left:8px"><h4><a style="color:buttonface">bieleen.com</a><h4></div>
                                <div id="div-main-logout" class="span1" style="margin-top: 10px;color: blanchedalmond"><a style="color:burlywood">logout</a></div>
                                </div>
                                </div>
                                <!-- phone main menu -->
                                <div class="visible-phone">
                                    <div class="navbar" style="min-width:376px">
                                        <div class="navbar-inner">
                                            <ul class="nav">
                                                <li class="active"><a>My Home</a></li>
                                                <li><a>My Services</a></li>
                                                <li><a>Service Store</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>

                                        <!-- main menu -->
                                        <div class="hidden-phone" style="margin-left: 0px; margin-top: 0">
                                            <?php if (!Yii::app()->user->isGuest): ?>
                                                <?php
                                                $mainMenu = Blyn::app()->getAppUI()->getMenu(BUIApp::MAINMENU);
                                                $items = $mainMenu['items'];
                                                ?>
                                                <!-- mainmenu -->

                                                <div class="navbar">
                                                    <div class="navbar-inner">
                                                        <a class="brand" href="<?php echo Blyn::app()->getUIManager()->getUrl(); ?>">Bieleen.com</a>
                                                        <ul class="nav">
                                                            <?php foreach ($items as $item) { ?>
                                                                <?php if (isset($item['ajaxUrl'])) { ?>
                                                                    <?php
                                                                    $class = '';
                                                                    if ($item['label'] == 'My Space') {
                                                                        $class = 'active';
                                                                    }
                                                                    ?>
                                                                    <li class="<?php echo $class; ?>"><?php echo $item['ajaxUrl']; ?></li>
                                                                    <?php
                                                                } else {
                                                                    $class = '';
                                                                    ?>
                                                                    <?php
                                                                    if ($item['label'] == 'My Space') {
                                                                        $class = 'active';
                                                                    }
                                                                    ?>
                                                                    <li class="<?php echo $class; ?>"><a href='<?php echo $item['url']; ?>'><?php echo $item['label']; ?></a></li>
                                                                <?php } ?>                                
                                                            <?php } ?>
                                                        </ul>
                                                    </div>
                                                </div>                                       
                                            <?php endif ?>
                                        </div>

                                        <?php if (isset($this->breadcrumbs)): ?>
                                            <?php
                                            $this->widget('zii.widgets.CBreadcrumbs', array(
                                                'links' => $this->breadcrumbs,
                                            ));
                                            ?>
                                            <!-- breadcrumbs -->
                                        <?php endif ?>


                                            
                                        <?php echo $content; ?>
                                            

                                        <div id="footer">
                                            Copyright &copy;
                                            <?php echo date('Y'); ?>
                                            by Bieleen.<br /> All Rights Reserved.<br />
                                        </div>
                                        <!-- footer -->

                                    </div>




                                    </body>
                                    </html>
